package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.tradeapplicationcredit.LindiTradeApplicationCreditQueryVO;
import com.minimalist.common.entity.lindi.vo.tradeapplicationcredit.LindiTradeApplicationCreditVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiTradeApplicationCreditFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;

import java.util.List;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 林地指标交易平台_交易申请征信 Feign 客户端
 *
 * @author 11987
 */
@FeignClient(name = "minimalist-lindi"
        , contextId = "lindiTradeApplicationCreditFeignClient"
        , path = "/minimalist/lindi/tradeApplicationCredit"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiTradeApplicationCreditFeignClientFallbackFactory.class)
public interface LindiTradeApplicationCreditFeignClient{

    /**
     * 添加交易申请征信
     *
     * @param tradeApplicationCreditVO 交易申请征信信息
     * @return 成功或失败
     */
    @PostMapping("/addTradeApplicationCredit")
    @Operation(summary = "添加交易申请征信")
    R<?> addTradeApplicationCredit(
            @RequestBody @Validated(Add.class)
            LindiTradeApplicationCreditVO tradeApplicationCreditVO);

    /**
     * 删除交易申请征信 -> 根据交易申请征信ID删除
     *
     * @param tradeApplicationCreditId 交易申请征信ID
     * @return 成功或失败
     */
    @DeleteMapping("/deleteTradeApplicationCreditByTradeApplicationCreditId")
    @Operation(summary = "删除交易申请征信 -> 根据交易申请征信ID删除")
    R<?> deleteTradeApplicationCreditByTradeApplicationCreditId(
            @RequestParam("tradeApplicationCreditId")
            @NotNull(message = "交易申请征信ID不能为空")
            @Parameter(name = "tradeApplicationCreditId", required = true, description = "交易申请征信ID")
            Long tradeApplicationCreditId);

    /**
     * 修改交易申请征信
     *
     * @param tradeApplicationCreditVO 交易申请征信信息
     * @return 成功或失败
     */
    @PutMapping("/updateTradeApplicationCreditByTradeApplicationCreditId")
    @Operation(summary = "修改交易申请征信")
    R<?> updateTradeApplicationCreditByTradeApplicationCreditId(
            @RequestBody @Validated(Update.class)
            LindiTradeApplicationCreditVO tradeApplicationCreditVO);

    /**
     * 查询交易申请征信列表(分页)
     *
     * @param queryVO 查询条件
     * @return 交易申请征信列表
     */
    @GetMapping("/getPageTradeApplicationCreditList")
    @Operation(summary = "查询交易申请征信列表(分页)")
    R<PageResp<LindiTradeApplicationCreditVO>> getPageTradeApplicationCreditList(
            @RequestBody LindiTradeApplicationCreditQueryVO queryVO);

    /**
     * 根据交易申请征信ID查询交易申请征信
     *
     * @param tradeApplicationCreditId 交易申请征信ID
     * @return 交易申请征信
     */
    @GetMapping("/getTradeApplicationCreditByTradeApplicationCreditId/{tradeApplicationCreditId}")
    @Operation(summary = "根据交易申请征信ID查询交易申请征信")
    R<LindiTradeApplicationCreditVO> getTradeApplicationCreditByTradeApplicationCreditId(
            @PathVariable(value = "tradeApplicationCreditId")
            @NotNull(message = "交易申请征信ID不能为空")
            @Parameter(name = "tradeApplicationCreditId", description = "交易申请征信ID", required = true)
            Long tradeApplicationCreditId);

    /**
     * 根据交易申请ID查询交易申请付款凭证列表
     *
     * @param tradeApplicationId 交易申请ID
     * @return 交易申请付款凭证列表
     */
    @GetMapping("/getTradeApplicationCreditListByTradeApplicationId/{tradeApplicationId}")
    @Operation(summary = "根据交易申请ID查询交易申请付款凭证列表")
    R<List<LindiTradeApplicationCreditVO>> getTradeApplicationCreditListByTradeApplicationId(
            @PathVariable(value = "tradeApplicationId")
            @NotNull(message = "交易申请ID不能为空")
            @Parameter(name = "tradeApplicationId", description = "交易申请ID", required = true)
            Long tradeApplicationId);
}